#pragma once
#include "String.h"
#ifdef _WIN32_WCE
#include "winsock2.h"
#else
#include "winsock.h"
#endif

void InitCritical();
void DeleCritical();

class jSocket
{
public:
	
	SOCKET s;

	AStr _tMsgRes;

	jSocket(){ s = -1; }
	jSocket(AStr ap) { Init(ap); }
	~jSocket();
	
	bool Init(char* a, short p);
	bool Init(AStr ap);
	
	bool Set(int OptName, int OptVal);
	
	bool Test(int uSecond);
	bool Write(AStr r);
	AStr Read();

	AStr Request(const AStr& r);

};

